<!-- dashboard.html -->
<!DOCTYPE html>
<html>
<head>
    <title>投资组合监控仪表盘</title>
    <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
    <div id="realtime-chart"></div>
    <div id="risk-metrics"></div>
    <div id="portfolio-weights"></div>

    <script>
        // 实时更新图表的JavaScript代码
        function updateCharts() {
            fetch('/api/dashboard/data')
                .then(response => response.json())
                .then(data => {
                    // 更新图表
                    Plotly.redraw('realtime-chart', data.chart_data);
                });
        }

        // 每5秒更新一次
        setInterval(updateCharts, 5000);
    </script>
</body>
</html>
